<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改需求单')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-require-edit" th:object="${lmRequire}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="userId" th:field="*{userId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">下架原因：</label>
                <div class="col-sm-8">
                    <textarea name="requireReason" th:field="*{requireReason}" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "lm/require";

        $(document).ready(function () {
            debugger;
            $("#fileinput-demo-1").fileinput({
                'uploadUrl': '#',
                overwriteInitial: true,
                initialPreviewAsData: true,
                showUpload:false,
                initialPreview: [
                    $("#requireImages").val()
                ]
            });
        });

        $("#form-require-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/stopRequire", $('#form-require-edit').serialize());
            }
        }

    </script>
</body>
</html>